import { http } from "@/utils/http";
import httpConfig from "@/utils/http/httpConfig";

// 字典类型列表
export function dictTypeLists(params?: any) {
  return http.post(httpConfig.system + "/dict/type/list", { data: params });
}

/**
 * 根据多个字典类型查询字典值
 * @param params  数组
 * @returns
 */
export function dictDataByTypes(params?: any) {
  return http.post(httpConfig.system + "/dict/data/type/dictTypes", {
    data: params
  });
}

/**
 * 获取字典数据 树形
 * @param params
 * @returns
 */
export function getDictTreeData(params?: any) {
  return http.get(httpConfig.system + "/dict/type/getDictTreeData", { params });
}

// 字典类型列表
export function dictTypeAll(params?: any) {
  return http.get(httpConfig.system + "/dict/type/all", { params });
}

// 添加字典类型
export function dictTypeAdd(params: any) {
  return http.post(httpConfig.system + "/dict/type", { data: params });
}

// 编辑字典类型
export function dictTypeEdit(params: any) {
  return http.post(httpConfig.system + "/dict/type/edit", { data: params });
}

// 删除字典类型
export function dictTypeDelete(params: any) {
  return http.post(httpConfig.system + "/dict/type/del", { data: params });
}

// 字典数据列表
export function dictDataLists(params: any) {
  return http.get(httpConfig.system + "/dict/data/list", { params });
}

// 添加字典数据
export function dictDataAdd(params: any) {
  return http.post(httpConfig.system + "/dict/data", { data: params });
}

// 编辑字典数据
export function dictDataEdit(params: any) {
  return http.post(httpConfig.system + "/dict/data/edit", { data: params });
}

// 删除字典数据
export function dictDataDelete(params: any) {
  return http.post(httpConfig.system + "/dict/data/del", { data: params });
}
